package com.example.tests;

public class ContactData implements Comparable<ContactData>{
	
	private String id;	
	private String firstName;
	private String lastName;
	private String address;
	private String homeTel;
	private String mobileTel;
	private String workTel;
	private String email;
	private String email2;
	private String birthdayDay;
	private String birthdayMonth;
	private String birthdayYear;
	private String groupSelect;
	private String addressSec;
	private String homeSec;

	
	public ContactData() {
		
	}
	
	public ContactData(String firstName, String lastName, 
			String address, String homeTel, String mobileTel, 
			String workTel,	String email, String email2,  
			String groupSelect, String addressSec,  String homeSec, 
			String birthdayMonth, String birthdayDay, String birthdayYear) {
		
		this.firstName = firstName;
		this.lastName = lastName;
		this.address = address;
		this.homeTel = homeTel;
		this.mobileTel = mobileTel;
		this.workTel = workTel;
		this.email = email;
		this.email2 = email2;
		this.birthdayDay = birthdayDay;
		this.birthdayMonth = birthdayMonth;
		this.birthdayYear = birthdayYear;
		this.groupSelect = groupSelect;
		this.addressSec = addressSec;
		this.homeSec = homeSec;

	}
	
	@Override
	public String toString() {
		return "ContactData [firstName=" + firstName + ", lastName=" + lastName + "]";
	}

	@Override
	public int compareTo(ContactData other) {
		   int comp = this.lastName.toLowerCase().compareTo(other.lastName.toLowerCase());
		   if (comp == 0) {
		     comp = this.firstName.toLowerCase().compareTo(other.firstName.toLowerCase());
		   }
		   return comp;
		  }

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime* result + ((firstName == null) ? 0 : firstName.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ContactData other = (ContactData) obj;
		if (firstName == null) {
			if (other.firstName != null)
				return false;
		} else if (!firstName.equals(other.firstName))
			return false;
		if (lastName == null) {
			if (other.lastName != null)
				return false;
		} else if (!lastName.equals(other.lastName))
			return false;
		return true;
	}

	public ContactData withFirstName(String firstName) {
		this.firstName = firstName;
		return this;
	}

	public ContactData withLastName(String lastName) {
		this.lastName = lastName;
		return this;
	}

	public ContactData withAddress(String address) {
		this.address = address;
		return this;
	}

	public ContactData withHomeTel(String homeTel) {
		this.homeTel = homeTel;
		return this;
	}

	public ContactData withMobileTel(String mobileTel) {
		this.mobileTel = mobileTel;
		return this;
	}

	public ContactData withWorkTel(String workTel) {
		this.workTel = workTel;
		return this;
	}

	public ContactData withEmail(String email) {
		this.email = email;
		return this;
	}

	public ContactData withEmail2(String email2) {
		this.email2 = email2;
		return this;
	}

	public ContactData withBirthdayYear(String birthdayYear) {
		this.birthdayYear = birthdayYear;
		return this;
	}
	
	public ContactData withBirthdayDay(String birthdayDay) {
		this.birthdayDay = birthdayDay;
		return this;
	}
	
	public ContactData withBirthdayMonth(String birthdayMonth) {
		this.birthdayMonth = birthdayMonth;
		return this;
	}

	public ContactData withHomeSec(String homeSec) {
		this.homeSec = homeSec;
		return this;
	}
	
	public ContactData withGroupSelect(String groupSelect) {
		this.groupSelect = groupSelect;
		return this;
	}

	public ContactData withAddressSec(String addressSec) {
		this.addressSec = addressSec;
		return this;
	}
	
	public ContactData withId(String id) {
		this.id = id;
		return this;
	}

	public String getFirstName() {
		return firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public String getAddress() {
		return address;
	}

	public String getHomeTel() {
		return homeTel;
	}

	public String getMobileTel() {
		return mobileTel;
	}

	public String getWorkTel() {
		return workTel;
	}

	public String getEmail() {
		return email;
	}

	public String getEmail2() {
		return email2;
	}
	public String getBirthdayDay() {
		return birthdayDay;
	}

	public String getBirthdayMonth() {
		return birthdayMonth;
	}
	public String getBirthdayYear() {
		return birthdayYear;
	}
	public String getGroupSelect() {
		return groupSelect;
	}

	public String getAddressSec() {
		return addressSec;
	}

	public String getHomeSec() {
		return homeSec;
	}
	
	public void setId(String id) {
		this.id = id;
	}

	public String getId() {
		return id;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public void setHomeTel(String homeTel) {
		this.homeTel = homeTel;
	}

	public void setMobileTel(String mobileTel) {
		this.mobileTel = mobileTel;
	}

	public void setWorkTel(String workTel) {
		this.workTel = workTel;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public void setEmail2(String email2) {
		this.email2 = email2;
	}

	public void setBirthdayDay(String birthdayDay) {
		this.birthdayDay = birthdayDay;
	}

	public void setBirthdayMonth(String birthdayMonth) {
		this.birthdayMonth = birthdayMonth;
	}

	public void setBirthdayYear(String birthdayYear) {
		this.birthdayYear = birthdayYear;
	}

	public void setGroupSelect(String groupSelect) {
		this.groupSelect = groupSelect;
	}

	public void setAddressSec(String addressSec) {
		this.addressSec = addressSec;
	}

	public void setHomeSec(String homeSec) {
		this.homeSec = homeSec;
	}
	
}